#include <iostream>
#include <time.h>
#include <string>
using namespace std;
float FindAreaRect(float w,float h )
{
return w*h;
}
float FindAreaCircle(float radius)
{
return (3.14)*radius*radius;
}
int  factorial ( int n)
{
	cout<<"the function is running again the number is now "<<n<< endl;
	if(n==0) return 1;
	else
		return n * factorial(n-1);
}
//int fib(int n)
//{
//	if(n<0)
//	{
//	cout<<"try to put positive number";
//	}
//	else if(n==0)
//	{
//	cout<< 1;
//	return 1;
//	}
//	else if(n==1)
//	{
//	cout<< 1;
//	return 1;
//	}
//	else
//	{
//	 cout<< fib(n-2);
//	 return fib(n-1);
//	}
//	
//}
//int fib(int n)
//{
//	
//  if(n == 0) return 0;
//  
//  if (n == 1). return 1;
//  
//	 return fib(n-1)  + fib(n-2);
//}

int main ()
{
	/*	int a,b;
	int tryNumbers=0;
	srand ( time(NULL) );
	a= rand() % 100;
	cout << "Guess the number between 0 to 100"<< endl;
	cin>> b;
	do
	{
	if(a<b)
	{
	cout << " Secret number is lower \n" ;
	cout << "Guess again"<< endl;
	cin>> b;
	tryNumbers+=1;
	}
	else if (a>b)
	{
	cout << " Secret number is greater \n" ;
	cout << "Guess again"<< endl;
	cin>> b;
	tryNumbers+=1;
	}

	}
	while(a!=b);
	cout << "Congratulations! \n" << " You did it in " << tryNumbers+1 << " times" ;*/
	//int aiGuess, secretNumber;
	//int range = 50;
	//int min = 1;
	//string state;
	//srand ( time(NULL) );
	//cout << " Write the secret number 1 to 50 \n" ;
	//cin >> secretNumber;
	//do
	//{
	//	aiGuess = (rand() % range) + min;
	//	cout << "That is my guess " << aiGuess<<" greater or lower ?" << endl;
	//	cin >> state;
	//	if (state == "greater")
	//	{
	//		range=range-aiGuess;
	//		min = aiGuess + 1;
	//	}
	//	else if (state == "lower")
	//	{
	//		range=aiGuess-min;
	//	}
	//}
	//while(aiGuess!=secretNumber)
	//cout << " Yeah I found it, it is "<< aiGuess << endl;

	//int a[11];
	//
	//for ( int i = 0 ; i<=10 ; i++)
	//{
	//	cout<< " Insert a number \n";
	//	cin>> a[i];
	//}
	//for ( int h = 0 ; h<=10 ; h++)
	//{
	//	cout<< a[h] << endl;
	//}


	//for(int h=0;h<10;h++)
	//{
	//	for(int a = 9 ; a>=h;a--)
	//   {
	//	cout<< " " ;
	//   }
	//	for(int x=0 ; x<h+1 ; x++)
	//	{
	//		cout<< "* "  ;
	//	}
	//	cout<< endl;
	//}


char arr [11][11]={{'9','|',' ',' ',' ',' ',' ',' ',' ',' ',' ' },
				   {'8',' |',' ',' ',' ',' ',' ',' ',' ',' ',' ' },
					{'7','|',' ',' ',' ',' ',' ',' ',' ',' ',' ' },
					{'6','|',' ',' ',' ',' ',' ',' ',' ',' ',' ' },
					{'5','|',' ',' ',' ',' ',' ',' ',' ',' ',' ' },
					{'4','|',' ',' ',' ',' ',' ',' ',' ',' ',' ' },
					{'3','|',' ',' ',' ',' ',' ',' ',' ',' ',' ' },					
					{'2','|',' ',' ',' ',' ',' ',' ',' ',' ',' ' },	
					{'1','|',' ',' ',' ',' ',' ',' ',' ',' ',' ' },
					{'0','|','_','_','_','_','_','_','_','_','_' },
					{'*','0','1','2','3','4','5','6','7','8','9' },
};
int arr2[10]={};
int x=8,q=8,w=8,e=8,r=8,t=8,y=8,u=8,o=8;

	for(int i=0; i<=9; i++) 
	{
	cout<<"Insert 10 numbers 1 to 9"<<endl;
	cin>>arr2[i];
	}
	system("PAUSE");
	cout<<endl;
	for(int h=0; h<=9; h++) 
	{
	 switch(arr2[h])
	 {
	 case 0:
	 break;
	  case 1:
	  arr[x][2]='*';
	  x--;
	 break;
	  case 2:
	   arr[q][3]='*';
	  q--;
	 break;
	  case 3:
	   arr[w][4]='*';
	  w--;
	 break;
	  case 4:
	   arr[e][5]='*';
	  e--;
	 break;
	  case 5:
	   arr[r][6]='*';
	  r--;
	 break;
	  case 6:
	   arr[t][7]='*';
	  t--;
	 break;
	  case 7:
	   arr[y][8]='*';
	  y--;
	 break;
	  case 8:
	   arr[u][9]='*';
	  u--;
	 break;
	  case 9:
	   arr[o][10]='*';
	  o--;
	 break;
	 default:
	 break;
	 }
	}
	for(int i=0; i<=10; i++)    
	{
	
		
		for(int j=0; j<=10; j++) 
		{			
			
			switch(arr[i][j])
			{
			case ' ':
				//arr[i][j]='*';
				break;
			default:
				break;
			}
			cout<< arr[i][j]<< " ";
		}
		cout<<endl;
	}
	/*float width,height,r;
	cout<<"Put the width and height for rect. \n";
	cin>>width;
	cin>>height;
	cout<<"The area of this rect. is "<< FindAreaRect(width,height)<< endl;
	cout<<"Put the radius for circle \n";
	cin>>r;
	cout<<"The area of this circle is "<< FindAreaCircle(r)<< endl;*/
 //int numbers[6];
	//for(int i=0;i<6;i++)
	//{
	//cout<<"insert 6 numbers";
	//cin>>numbers[i];
	//}

	//putLine(numbers);
	//
	/*int y;
	cout<<"put a number ";
	cin>>y;
	cout<<"the factorial of "<<y<<"is "<<factorial(y)<<"\n";
	system("pause");*/
	//int y;
	//cout<<"put a number ";
	//cin>>y;
	//for (int i=0; i < y; i++)
	//{
	//   cout << fib(i) << " ";
	//}
	//
	system("pause");

}
